package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-07-27
 * Time: 9:54
 */
public class Test1 {

    public static class MyRunnable implements Runnable{
        @Override
        public void run() {
            System.out.println("我是Thread!!!");
        }
    }

    public static void main(String[] args) {
        Runnable r = new MyRunnable();//创建Runnable接口的实例
        Thread t = new Thread(r);//将Runnable接口对象传进Thread中
        t.start();
        System.out.println("我是main!!!");
    }

}
